home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1998 September
/
Macworld (1998-09).dmg
/
Serious Demos
/
DesignWorks 4.0.1 Demo PPC
/
Design Kits
/
PCB Shared Items
/
Scripts
/
PCB Error Script
< prev
next >
Wrap
Text File
|
1997-05-28
|
4KB
|
212 lines
{
Error checking script for Generic PCB Design Kit
C. Dewhurst, May 22, 1997
©1996 Capilano Computing Systems Ltd.
This script checks for:
- Devices without a package code
- Bad device names
- Bad or duplicate pin numbers
- Bad or duplicate signal names
}
$IF($NOT($ISFLAT))
$NULL($ALERT1(This report script will only work in Flat hierarchy mode!))
$ABORT
$END
{
First, see if we're clearing all errors
}
$IF($EQ(&_Operation, UnmarkOK))
$REPORTOFF
$IF($NOT($ALERT2(This will clear all Mark as OK settings in this design!)))
$ABORT
$END
$DEVICES$CLEARERRORS
$SIGNALS$CLEARERRORS
$ABORT
$END
{
If we're doing a "Mark as OK", we don't want any report
}
$IF($EQ(&_Operation, MarkOK))
$REPORTOFF
$IF($NOT($ALERT2(This will mark all current errors as OK!)))
$ABORT
$END
$ELSE
$CREATEREPORT($DESIGNNAME.Errors) $PROMPT
Error report for $DESIGNNAME on $DATE at $TIME
$END
{
Listing defaults
}
$PROGRESS $PERCENTOFF
$SIGSOURCE(Ground)
$SIGSOURCE(Plus5V) &Power
$DESIGNSIGSOURCE &SigSources
$AUTONUMBER(3)
$BUSNAMEON(_)
$SETVAR(_AnyErrors, 0)
{
Issue a warning if any devices have no package code
}
$FIND $DEVICES $NOT(&Package) $ERRORBITOFF(8)
$IF($GT($DEVCOUNT, 0))
The following devices have no package code:
$SORT $DEVICES $DEVNAME
$COMBDEVSON
$IF($EQ(&_Operation, MarkOK))
$DEVICES$SETERRORBIT(8)
$ELSE
$DEVICES$DEVNAME $TYPENAME $PAGE
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $DEVCOUNT))
$END
$END
{
Check for multiple package codes in same package
}
$FIND $DEVICES
$SORT $DEVICES $DEVNAME
$COMBDEVSON
$FIND $NOCLEAR $DEVICES $GT($COUNTVALUES(&Package), 1) $ERRORBITOFF(9)
$IF($GT($DEVCOUNT, 0))
The following devices have inconsistent package codes:
$SORT $DEVICES $DEVNAME
$COMBDEVSON
$IF($EQ(&_Operation, MarkOK))
$DEVICES$SETERRORBIT(9)
$ELSE
$DEVICES$DEVNAME $TYPENAME $PAGE
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $DEVCOUNT))
$END
$END
{
Check for duplicate pin numbers
}
$PROGRESS(Checking pin numbers)
$FIND $DEVICES
$SORT $DEVICES $DEVNAME
$COMBDEVSON
$DEVPINFORMAT $GT($SAMEPINCOUNT, 1)
$FIND $SIGNALS
$FIND $NOCLEAR $DEVICES $NONBLANK($MERGE$PINS) $ERRORBITOFF(10)
$IF($GT($DEVCOUNT, 0))
The following devices have duplicate pin numbers:
$SORT $DEVICES $DEVNAME
$COMBDEVSON
$IF($EQ(&_Operation, MarkOK))
$DEVICES$SETERRORBIT(10)
$ELSE
$DEVICES$DEVNAME $TYPENAME $PAGE
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $DEVCOUNT))
$END
$END
{
Check for invalid pin numbers
}
$DEVPINFORMAT $REGEXP(\D?|.*\D.*, $PINNUM)
$FIND $DEVICES $NONBLANK($PINS) $ERRORBITOFF(11)
$IF($GT($DEVCOUNT, 0))
The following devices have bad pin numbers:
$SORT $DEVICES $DEVNAME
$COMBDEVSON
$IF($EQ(&_Operation, MarkOK))
$DEVICES$SETERRORBIT(11)
$ELSE
$DEVICES$DEVNAME $TYPENAME $PAGE
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $DEVCOUNT))
$END
$END
{
Check for bad device names
}
$PROGRESS(Checking device and signal names)
$FIND $DEVICES $NOT($REGEXP(\w+, $DEVNAME)) $ERRORBITOFF(0)
$IF($GT($DEVCOUNT, 0))
The following devices have bad device names:
$SORT $DEVICES $DEVNAME
$COMBDEVSON
$IF($EQ(&_Operation, MarkOK))
$DEVICES$SETERRORBIT(0)
$ELSE
$DEVICES$DEVNAME $TYPENAME $PAGE
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $DEVCOUNT))
$END
$END
{
Check for bad signal names
}
$UNNAMEDSIGS(????)
$FIND $SIGNALS $NOT($REGEXP(\w+, $SIGNAME)) $ERRORBITOFF(0)
$IF($GT($SIGCOUNT, 0))
The following signals have bad names:
$SORT $SIGNALS $SIGNAME
$IF($EQ(&_Operation, MarkOK))
$SIGNALS$SETERRORBIT(0)
$ELSE
$FIND $DEVICES
$SIGNALS$SIGNAME $PINS
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $SIGCOUNT))
$END
$END
{
Check for duplicate signal names
}
$FIND $SIGNALS
$COMBSIGSON
$SORT $SIGNALS $SIGNAME
$FIND $NOCLEAR $SIGNALS $COUNT(2) $ERRORBITOFF(1)
$IF($GT($SIGCOUNT, 0))
The following signals have duplicate names:
$SORT $SIGNALS $SIGNAME
$IF($EQ(&_Operation, MarkOK))
$SIGNALS$SETERRORBIT(1)
$ELSE
$SIGNALS$SIGNAME $PAGE
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $SIGCOUNT))
$END
$END
{
Check for null signals
}
$FIND $DEVICES
$FIND $SIGNALS $NUMPINS(1) $NOT($NUMPINS(2)) $ERRORBITOFF(2)
$COMBSIGSOFF
$IF($GT($SIGCOUNT, 0))
The following signals have only one pin connection:
$SORT $SIGNALS $SIGNAME
$IF($EQ(&_Operation, MarkOK))
$SIGNALS$SETERRORBIT(2)
$ELSE
$SIGNALS$SIGNAME $PAGE
$SETVAR(_AnyErrors, $PLUS(&_AnyErrors, $SIGCOUNT))
$END
$END
{
If we're reporting, put up an error box
}
$IF($NE(&_Operation, MarkOK))
$IF($GT(&_AnyErrors, 0))
$NULL($ALERT1(&_AnyErrors errors found!))
$ELSE
$NULL($ALERT1(No errors found!))
$END
$END